<?php
echo "Hello World!";
$x = 5;
$txt = "Hello world!";
echo $x;

function myTest() {
    // using x inside this function will generate an error
    echo "<p>Variable x inside function is: $x</p>";
}

function globalTest() {
    global $x;
    echo "<p>Variable x inside function is: $x</p>";
}
function staticTest()
{
        static $a = 0;
        echo $a;
        $a++;
        echo PHP_EOL;
}
staticTest();
staticTest();
staticTest();


function paramterTest($a)
{
        echo $a;
        echo PHP_EOL;
}


echo "<h2>PHP 很有趣!</h2>";
echo "Hello world!<br>";
echo "我要学 PHP!<br>";
echo "这是一个", "字符串，", "使用了", "多个", "参数。";

$txt1="学习 PHP";
$txt2="RUNOOB.COM";
$cars=array("Volvo","BMW","Toyota");
 
print $txt1;
print "<br>";
print "在 $txt2 学习 PHP ";
print "<br>";
print "我车的品牌是 {$cars[0]}";


echo <<<EOF
 <h1>我的第一个标题</h1>
 <p>我的第一个段落。</p>
EOF;

$name="runoob";
$a= <<<EOF
        "abc"$name
        "123"
EOF;
// 结束需要独立一行且前后不能空格
echo $a;
?>